#ifndef WGETS__H
#define WGETS_H

#ifndef _WIN32
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>

#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>

/*The Following Error Codes For Ftp Request and General Success and Failure*/

#define SUCCESS			0           	/* Success */
#define FAILURE			-1          	/* Failure */
#define ERR_CONNECT		1		/* connect() failed */
#define ERR_CONTINUE		2		/* continue download failed */
#define ERR_FSTAT		3		/* fstat() failed */
#define ERR_WRITE		4		/* writing to network stream failed */
#define ERR_NETREAD		5		/* reading from network stream failed */
#define ERR_CONN		6		/* error opening FTP session */
#define ERR_FILE_UNAVAIL	7		/* file is unavailable */
#define ERR_LOGFAILED		8		/* login failed */
#define ERR_FSIZE		9		/* error getting remote file size */
#define ERR_PASV		10		/* entering passive mode failed */
#define ERR_URL			11		/* error in URL string */
#define ERR_FOPEN		12		/* error opening stream */
#define ERR_FGET		13		/* fgets() failed */
#define ERR_NAMERES		14		/* name resolution failed */

/*The following Errors Were Aadded for Http file Testing By Srini in Sep/2005 */

#define ERR_HSERVER_NORESP   15    /* No Response from Server*/
#define ERR_HCONTENT_LEN     16    /* Error in Content Length*/ 
#define ERR_HTRANSFER_ENCODE 17    /* Error in Transfer Encoding */
#define ERR_HMANY_REDIR      18    /* So Many Redirections(try>5)*/
#define ERR_HBAD_HEADER      19    /* Bad Http Header*/
#define ERR_HCONTIME_OUT     20    /* Connection Timed Out //401*/
#define ERR_HFILENOT_FOUND   21    /* File is not found in Specific Location/404*/
#define ERR_HUNKNOWN_REQ     22    /* Unknown Http  Request 408 */
#define ERR_HUNKNOWN         23    /* Unknown Error Occured while http req processing */

#define ERR_NOINPUT_URL      24   /* No Url Given to Wget function  */ 
#define ERR_NOINPUT_FILE     25   /* No input Result file specified in wget Request*/


extern int wget(char*);
extern int procWgetError(int);
extern int bb_errno;
extern char* clientProcess();

#endif
#endif


